<!--
//
// PdfViewer.vue
// hs-admin
//
// Created by 区区电脑 on 2023/05/03.
//
-->
<template>
    <div class="PdfViewer">
        <!--<div class="cover"></div>-->
        <iframe class="iframe" :src="url"></iframe>
    </div>
</template>

<script setup>
import {ref, reactive, computed, onMounted} from "vue";
import {useStore} from "vuex";
import {useRouter} from "vue-router";

const props = defineProps({
    src: {
        type: String,
        default: () => ""
    },
    title: {
        type: String,
        default: () => "pdf"
    }
});
const emits = defineEmits();

// 路由
const router = useRouter();
// store
const store = useStore();

const url = computed(() => {
    return `${window.$config.baseUrl}/pdfviewer/index.html?file=${props.src}&title=${props.title}`
})

onMounted(() => {
})
</script>

<style scoped lang="scss">
.PdfViewer {
    width: 100%;
    height: 100%;
    position: relative;
    //.cover {
    //    position: absolute;
    //    top: 0;
    //    right: 0;
    //    width: 160px;
    //    height: 58px;
    //    background-color: rgba(51, 54, 57, 1);
    //    z-index: 10;
    //}
    .iframe {
        width: 100%;
        height: 100%;
        border: none;
    }
}
</style>
